//package com.laolu.train.business.controller;
//
//import jakarta.annotation.Resource;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.concurrent.TimeUnit;
//
//@RestController
//public class RedisController {
//
//    private static final Logger LOG = LoggerFactory.getLogger(RedisController.class);
//
//    @Resource
//    private RedisTemplate redisTemplate;
//
//    @RequestMapping("/redis/set/{key}/{value}")
//    public String set(@PathVariable String key, @PathVariable String value) {
//        redisTemplate.opsForValue().set(key, value, 3600, TimeUnit.SECONDS);
//        LOG.info("key: {}, value: {}", key, value);
//        return "success";
//    }
//
//    @RequestMapping("/redis/get/{key}")
//    public Object get(@PathVariable String key) {
//        Object object = redisTemplate.opsForValue().get(key);
//        LOG.info("key: {}, value: {}", key, object);
//        return object;
//    }
//}
